package com.tengju.support.domain.model.message;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.List;

@Getter
@AllArgsConstructor
public enum MessageChannel {

    STATION_LETTER(1,"站内信",List.of(MessageType.BULLETIN,MessageType.PRIVATE_MESSAGE,MessageType.SYSTEM_INFORMATION),"stationLetterSendStrategy"),
    APP_PUSH(2,"app推送",List.of(MessageType.APP_PUSH),"appPushSendStrategy"),
    SMS(3,"短信",List.of(MessageType.SMS),"smsSendStrategy"),
    ;

    private Integer val;
    private String desc;
    private List<MessageType> messageTypes;
    private String strategy;

    public static MessageChannel parseByMessageType(MessageType messageType) {
        for (MessageChannel type : values()) {
            if (type.messageTypes.contains(messageType)) {
                return type;
            }
        }
        return null;
    }







}
